<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>

<div class="page">
    <div class="pageContent">


        <form method="post" action="${ctx}/food/food!save.action" class="pageForm required-validate"
              onsubmit="return iframeCallback(this,dialogAjaxDone)" enctype="multipart/form-data">
            <input type="hidden" name="id" value="${id}"/>

            <div class="pageFormContent" layoutH="70" id="user-accource">


                <div class="unit">
                    <label>食物名称:</label>
                    <input type="text" name="foodName" size="40" id="foodName" class="required" value="${foodName}"/>

                </div>

                <div class="unit">
                    <label>所属类别:</label>
                    <select name="foodType" id="foodType">
                        <s:iterator value="foodTypePojos" var="item">
                            <option value="${item.id}" <c:if test="${item.id==entity.foodType}">selected</c:if>>
                                【一级】${item.name}</option>
                            <s:iterator value="foodTypePojoList" var="second">
                                <option value="${second.id}" <c:if test="${second.id ==entity.foodType}">selected</c:if>>
                                    &nbsp;&nbsp;【二级】${second.name}</option>

                                <s:iterator value="foodTypePojoList" var="third">
                                    <option value="${third.id}" <c:if test="${third.id ==entity.foodType}">selected</c:if>>
                                        &nbsp;&nbsp; &nbsp;&nbsp;【三级】${third.name}</option>


                                </s:iterator>


                            </s:iterator>
                        </s:iterator>
                    </select>
                </div>


                <div class="unit">
                    <label>单价:</label>
                    <input type="text" name="price" size="40" id="price" class="required number" value="${price}"/>

                </div>


                <div class="unit">
                    <label>折扣价</label>
                    <input type="text" name="disCountPrice" size="40" id="disCountPrice" class="required number"
                           value="${disCountPrice}"/>

                </div>


                <div class="unit">
                    <label>状态</label>
                    <select name="type">
                        <option value="1" <c:if test="${type==1}">selected</c:if>>上线</option>
                        <option value="2"
                                <c:if test="${type==2}">selected</c:if> >下线
                        </option>
                    </select>

                </div>

                <div class="unit">
                    <label>图片</label>
                    <input type="file" name="foodImage" size="40" id="image"/>
                </div>


                <c:if test="${id != null}">
                    <div class="unit">
                        <label>图片</label>
                        <img src="${image}" width="50px" height="50px">
                    </div>
                </c:if>

                <div class="unit">
                    <label>口味</label>
                    <s:checkboxlist name="foodTasteNames" list="foodTasteList" listKey="name" listValue="name"
                                    theme="custom"/>
                    <%--<s:iterator value="foodTasteList" var="item">--%>
                    <%--${name}<input type="checkbox" name="foodTastes" value="${name}"--%>
                    <%--</s:iterator>--%>


                </div>

                <div class="unit">
                    <label>备注</label>
                    <input type="text" name="other" size="40" id="other"
                           value="${other}"/>
                </div>


                <div class="unit">
                    <label>描述</label>
                    <input type="text" name="description" size="40" id="description"
                           value="${description}"/>

                </div>

            </div>

            <div class=" formBar">
                <ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit" class="toolBar-btn">提交</button>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="button">
                            <div class="buttonContent">
                                <button type="button" class="close toolBar-btn2">取消</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>

        </form>

    </div>
</div>
